Imports Newtonsoft.Json
Imports Newtonsoft.Json.Converters
Imports System
Imports System.Runtime.CompilerServices

Namespace Helpers
    Public Class Serializer
        Public Shared Function Serialize(obj As Object) As String
            Dim jsonSerializerSettings As JsonSerializerSettings = New JsonSerializerSettings()
            jsonSerializerSettings.Converters.Add(New JavaScriptDateTimeConverter())
            Return JsonConvert.SerializeObject(RuntimeHelpers.GetObjectValue(obj), jsonSerializerSettings)
        End Function
    End Class
End Namespace
